home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / debug.lzh / C / Enforcer.doc < prev    next >
Encoding:
Text File  |  1992-09-24  |  24.1 KB  |  492 lines

  1. TABLE OF CONTENTS
  2.  
  3. Enforcer
  4. LawBreaker
  5. Move4K
  6. Enforcer                                                             Enforcer
  7.  
  8.    NAME
  9.     Enforcer V37 - An advanced version of Enforcer - Requires V37
  10.  
  11.    SYNOPSIS
  12.     Enforcer - A tool to watch for illegal memory accesses
  13.  
  14.    FUNCTION
  15.     Enforcer will use the MMU in the advanced 680x0 processors
  16.     to set up MMU tables to watch for illegal accesses to memory
  17.     such as the low-page and non-existent pages.
  18.  
  19.     To use, run Enforcer (plus any options you may wish)
  20.     If you wish to detach, just use RUN >NIL: <NIL: to start it.
  21.     You can also start it from the Workbench.  When started from Workbench,
  22.     Enforcer will read the tooltypes of its icon or selected project icon
  23.     for its options.  (See the sample project icons)
  24.  
  25.     Enforcer should only be run *after* SetPatch.
  26.  
  27.    INPUTS
  28.     The options for Enforcer are as follows:
  29.  
  30.     QUIET/S        - This tells Enforcer to not complain about any invalid
  31.                      access and to just build MMU tables for cache setting
  32.                      reasons.  This is mainly used in conjunction with
  33.                      an Amiga BridgeBoard in a 68030 environment.
  34.  
  35.     TINY/S         - This tells Enforcer to output a minimal hit.  The
  36.                      output is basically the first line of the Enforcer
  37.                      hit.  (see below)
  38.  
  39.     SMALL/S        - This tells Enforcer to output the hit line, the
  40.                      USP: line, and the Name: line.  (This means that
  41.                      no register or stack display will be output)
  42.  
  43.     SHOWPC/S       - This tells Enforcer to also output the two lines
  44.                      that contain the memory area around the PC where
  45.                      the hit happened.  Useful for disassembly.
  46.                      This option will not do anything if QUIET, SMALL or
  47.                      TINY output modes are selected.
  48.  
  49.     STACKLINES/K/N - This lets you pick the number of lines of stack
  50.                      backtrace to display.  The default is 2.  If set
  51.                      to 0, no stack backtrace will be displayed.  There
  52.                      is no enforced limit on the number of lines.
  53.  
  54.     DEADLY/S       - This makes Enforcer be a bit more nasty.  Normally,
  55.                      when an illegal read happens, Enforcer returns 0
  56.                      as the result of this read.  With this option,
  57.                      Enforcer will return $ABADFEED as the read data.
  58.                      This option can make programs with Enforcer hits
  59.                      cause even more hits.
  60.  
  61.     FSPACE/S       - This option will make the special $00F00000 address
  62.                      space available for writing to.  This is useful for
  63.                      those people with $00F00000 boards.  (Mainly Commodore
  64.                      internal development work)
  65.  
  66.     VERBOSE/S      - This option will make Enforcer display special
  67.                      start-up information.  This information maybe useful
  68.                      in specialized debugging problems.
  69.  
  70.     PARALLEL/S     - This option will make Enforcer use the parallel port
  71.                      hardware rather than the serial port for output.
  72.  
  73.     RAWIO/S        - This option will make Enforcer stuff the hit report
  74.     (special IO)     into an internal buffer and then output the results
  75.                      via the RawPutChar() EXEC debugging LVO.  Since this
  76.                      LVO is called, it is not called during the bus error
  77.                      and thus if the Enforcer hit happens as the system is
  78.                      crashing, the hit will not be reported.  (This is
  79.                      one of the reasons the default mode is to hit the
  80.                      hardware directly.)
  81.  
  82.     FILE/K         - This option will make Enforcer output the hit report
  83.     (special IO)     not via the RAWIO LVO but to the file given.
  84.                      A good example of such a file is CON:0/0/640/100/HIT
  85.                      Another thing that can be done is to have a program
  86.                      sit on a named pipe and have Enforcer output to it.
  87.                      This program can then do whatever it feels like with
  88.                      the Enforcer hits.  (Such as decode them, etc.)
  89.                      *NOTE*  It is not a good idea to have Enforcer hits
  90.                      go to a file on a disk as if the system crashes
  91.                      during/after the Enforcer hit, the disk may
  92.                      become corrupt.
  93.  
  94.     STDIO/S        - This option will make Enforcer output the hit report
  95.     (special IO)     not to a FILE but rather to STDOUT.  This option
  96.                      only works from the CLI as it requires STDOUT.  It is
  97.                      best used with redirection or pipes.
  98.  
  99.     BUFFERSIZE/K/N - This lets you set Enforcer's internal output buffer
  100.                      for the special I/O options.  This option is invalid
  101.                      unless one of the special I/O options is used.
  102.                      The minimum setting is 8000.  The default is 8000.
  103.                      Having the right amount of buffer is rather
  104.                      important for the special I/O modes.  The reason
  105.                      is due to the fact that no operating system calls
  106.                      can be made from a bus error.  Thus, in the
  107.                      special I/O mode, Enforcer must store the output
  108.                      in this buffer and, via some special magic,
  109.                      wake up the Enforcer task to read the buffer and
  110.                      write it out as needed.  However, if a task is
  111.                      in Forbid() or Disable() when the Enforcer hit
  112.                      happens, the Enforcer task will not be able to
  113.                      output the results of the hit.  This buffer lets
  114.                      a number of hits happen even if the Enforcer task
  115.                      was unable to do the I/O.  If the number of
  116.                      hits that happen before the I/O was able to
  117.                      run gets too large, the last few hits will either
  118.                      be cut off completely or contain only partial
  119.                      information.
  120.  
  121.     INTRO/K        - This optional introduction string will be output
  122.                      at the start of every Enforcer hit.  The default
  123.                      is no string.  For example:  INTRO="*NBad Program!"
  124.  
  125.     PRIORITY/K/N   - This lets you set Enforcer's I/O task priority.
  126.                      The default for this priority is 99.  In some
  127.                      special cases, you may wish to adjust this.
  128.                      It is, however, recommended that if you are using
  129.                      one of the special I/O options (RAWIO or FILE
  130.                      or STDIO) that you keep the priority rather high.
  131.                      The value is not checked for valid priority range.
  132.  
  133.     ON/S           - Mainly for completeness.  If not specified, it
  134.                      is assumed you want to turn ON Enforcer.
  135.  
  136.     QUIT=OFF/S     - Tells Enforcer to turn off.  Enforcer can also be
  137.                      stopped by sending a CTRL-C to its process.
  138.  
  139.    RESULTS
  140.     When running, Enforcer will build a set of MMU tables that will map the
  141.     invalid address as invalid such that any access to them will cause a
  142.     access violation and a report to be output.  In addition, the low
  143.     memory space (starting at location 0) will be marked as invalid (other
  144.     than location 4 - AbsExecBase, which will be READ-ONLY).  When an
  145.     access violation happens, a report such as the following will be
  146.     set out to the debugging port:
  147.  
  148. WORD-WRITE to  00000000        data=4444       PC: 07895CA4
  149. USP:  078D692C SR: 0000 SW: 0729  (U0)(-)(-)  TCB: 078A2690
  150. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  151. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  152. Stck: 00000000 07848E1C 00009C40 078A30B4 BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  153. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 078E9048 00011DA8 DEADBEEF
  154. PC-8: AAAA1111 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C40000
  155. PC *: 522E0127 201433FC 400000DF F09A522E 012611C7 00CE4EAE FF7642B8 0324532E
  156. Name: "New_Shell"  CLI: "lawbreaker"  Hunk 0000 Offset 0000007C
  157.  
  158. LONG-READ from AAAA4444                        PC: 07895CA8
  159. USP:  078D692C SR: 0015 SW: 0749  (U0)(F)(-)  TCB: 078A2690
  160. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  161. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  162. Stck: 00000000 07848E1C 00009C40 078A30B4 BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  163. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 078E9048 00011DA8 DEADBEEF
  164. PC-8: 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C40000 522E0127
  165. PC *: 201433FC 400000DF F09A522E 012611C7 00CE4EAE FF7642B8 0324532E 01266C08
  166. Name: "New_Shell"  CLI: "lawbreaker"  Hunk 0000 Offset 00000080
  167.  
  168.     Here is a breakdown of what these reports are saying:
  169.  
  170.     The first line of each report contains the access violation that
  171.     happened and where it happened from.  In the case of a WRITE, the data
  172.     that was being written will be displayed as well.  If an instruction
  173.     mode access caused the fault, there will be an (INST) in the line.
  174.  
  175.     The second line (starts USP:) displays the USER stack pointer (USP),
  176.     the status register (SR:), the special status word (SW:).  It then
  177.     displays the supervisor/user state and the interrupt level.  This
  178.     will be from (U0) to (U7) or (S0) to (S7)  (S=Supervisor)  Next
  179.     is the forbid state (F=forbid, -=not) and the disable state (D or -)
  180.     of the task that was running when the access fault took place.
  181.     Finally, the task control block address is displayed (TCB:)
  182.  
  183.     The next two lines contain the data and address register dumps from
  184.     when the access fault happened.  Note that A7 is not listed here.
  185.     It is the stack pointer and is listed as USP: in the line above.
  186.  
  187.     Then come the lines of stack backtrace.  These lines show the
  188.     data on the stack.  If the stack is in invalid memory, Enforcer will
  189.     display a message to that fact.
  190.  
  191.     Next, optionally, comes the data around the program counter when the
  192.     access fault happened.  The first line (PC-8:) is the 8 long-words
  193.     before the program counter.  The second line starts at the program
  194.     counter and goes for 8 long words.
  195.  
  196.     The last line displays the name of the task that was running when
  197.     the access fault took place.  It the task was a CLI, it will display
  198.     the name of the CLI command that was running.  If the access fault
  199.     was found to have happened within the seglist of a loaded program,
  200.     the segment number and the offset from the start of the segment will
  201.     be displayed.  (Note that this works for any LoadSeg()'ed process)
  202.  
  203.    NOTES
  204.     This new Enforcer is a completely new program.  Bryce Nesbitt came up
  205.     with the original "Enforcer" that has been instrumental to the
  206.     improvement in the quality of software on the Amiga.  The Amiga users
  207.     and developers owe him a great deal for this.  Thank you Bryce!
  208.  
  209.     This Enforcer came about due to a number of needs.  These included
  210.     the need for more output options and better performance.  It also
  211.     marks the removal of all kludges that were in the older versions.
  212.     Also, some future plans required some of these changes...
  213.  
  214.     In addition, the complete redesign was needed in order to also
  215.     support the 68040.  The internal design of Enforcer is now set up
  216.     such that CPU/MMU specific code can be cleanly accessed from
  217.     the general house keeping aspect of the code.  The MMU bus error
  218.     handling is, however, 100% CPU specific.
  219.  
  220.     Since AbsExecBase is in low memory, reads of this address are
  221.     slower with Enforcer running.  Caching AbsExecBase locally is
  222.     highly recommended since it is in CHIP memory and on systems with
  223.     FAST memory, it will be faster to access the local cached value.
  224.     (In addition to the performance increase when running Enforcer)
  225.     Note that doing many reads of location 4 will hurt interrupt
  226.     performance.
  227.  
  228.     When the Amiga produces an ALERT, EXEC places some magic numbers into
  229.     some special locations in low memory.  The exact pattern changes
  230.     between versions of the operating system.
  231.  
  232.     Enforcer will patch the EXEC function ColdReboot() in an attempt
  233.     to "get out of the way" when someone tries to reboot the system.
  234.     Enforcer will clean up as much as possible the MMU tables and
  235.     then call the original LVO.  When Enforcer is asked to quit, it
  236.     will check to make sure it can remove itself from this LVO.
  237.     If it can not, it will not quit at that time.  If run from the
  238.     shell, it will display a message saying that it tried but could
  239.     not exit.  Enforcer will continue to be active and you can try
  240.     later to deactivate it.
  241.  
  242.    68020 NOTES
  243.     The 68020 does not have a built-in MMU but has a co-processor feature
  244.     that lets an external MMU be connected.  Enforcer MMU code is designed
  245.     for use with 68851 MMU.  This is the some-what 68030 compatible
  246.     MMU by Motorola.  Enforcer uses the same code for both the 68030 and
  247.     the 68020/68851.  For this reason, 68020/68851 users should
  248.     see the 68030 NOTES section.
  249.  
  250.    68030 NOTES
  251.     To make the MMU tables smaller and to have less impact on performance,
  252.     the 68030 design uses early termination in the MMU tables.  (A feature
  253.     that the 68040 CPU does not have)  This does, however, mean that
  254.     (currently) certain memory configurations will end up causing
  255.     large areas to become valid memory.  Depending on the hardware in
  256.     your system, this may not be an issue.  If the hardware generates
  257.     a physical BUS ERROR when access to non-memory happens, you will
  258.     still get the correct Enforcer report.  The lowest 16M of memory
  259.     is partitioned rather finely, with the lowest section of memory
  260.     using 1K pages such that the lowest 1K can be correctly protected.
  261.  
  262.     The 68030 handler uses cycle/instruction continuation and will
  263.     supply the data rather than cause the real bus cycle to happen.
  264.     This means that on a fault caused by MMU tables, no bus cycle
  265.     will be generated.  (For those of you with analyzers)
  266.  
  267.     In some cases, the 68030 will have advanced the Program Counter
  268.     past the instruction by the time the access fault happens.
  269.     This is usually only on WRITE faults.  For this reason, the PC
  270.     may either point at the instruction that caused the fault or
  271.     just after the instruction that caused the fault.  (Which could
  272.     mean that it is pointing to the middle of the instruction
  273.     that caused the fault.)
  274.  
  275.    68040 NOTES
  276.     Enforcer, on the 68040, *requires* that the 68040.library be
  277.     installed and it requires an MMU 68040 CPU.  The 68EC040 does
  278.     not have a MMU.  The 68LC040 does have an MMU and is supported.
  279.     Enforcer will work best in a system with the 68040.library 37.10
  280.     or better but it does know how to deal with systems that do not
  281.     have that version.
  282.  
  283.     Due to the design of the 68040, Enforcer is required to do a number
  284.     of things differently.  For example, the MMU page size can only be
  285.     either 8K or 4K.  This means that to protect the low 1K of memory,
  286.     Enforcer will end up having to invalidate the first 4K of memory
  287.     and emulate the access to the 3K of that memory that is valid.
  288.     For this reason, there are a number of possible system structures
  289.     that, if found in the first 4K of memory, are moved to higher
  290.     addresses.  This means, however, that the first time you run
  291.     Enforcer on a 68040 system, it may end up allocating some memory
  292.     that will never come back.  Not to worry, this is such that
  293.     the system continues to run at a reasonable speed.  You may
  294.     also wish to look at the Move4K utility for more information.
  295.  
  296.     In addition to the fact that the 68040 MMU table size is different,
  297.     the address fault handling is also different.  Namely, the 68040
  298.     can only rerun the cycle and not continue it like the 68030.
  299.     This means that on a 68040, the page must be made available first
  300.     and then made unavailable.  Make this work, the 68040 code will
  301.     switch the instruction that caused the error into trace mode
  302.     and let it run with a special MMU setup.  When the trace exception
  303.     comes in, the MMU is set up back to the way it was.  Enforcer
  304.     does its best to keep debuggers working.  Note, however, that
  305.     the interrupt level during a trace of a READ will end up being
  306.     set to 7.  This is to prevent interrupts from changing the order
  307.     of trace/MMU table execution.  The level will be restored to
  308.     the original state before continuing.  Since T0 mode tracing
  309.     is also supported, there are also some changes in the way
  310.     it operates.  T0 mode tracing is defined, on the 68040, to
  311.     cause a trace whenever the instruction pipeline needed to be
  312.     reloaded.  While on the 68020/030 processors this was normally
  313.     only for the branch instructions, in the 68040 this includes
  314.     a large number of other instructions.  (Including NOP!)  Anyway,
  315.     if an Enforcer hit happens while in T0 tracing mode, the trace
  316.     will happen even on instructions that normally would not cause
  317.     a T0 mode trace.  Since this may actually help in debugging and
  318.     because it was not possible to do anything else, this method
  319.     of operation is deemed acceptable.
  320.  
  321.     Another issue with the 68040 is that WRITE faults happen *after*
  322.     the instruction has executed.  (Except for MOVEM)  In fact,
  323.     many times one or more instructions after that instruction also
  324.     execute before the WRITE fault is actually executed.  This design
  325.     makes the 68040 much faster, but it also makes the Program Counter
  326.     value that Enforcer can report for the fault much less likely to be
  327.     pointing to the instruction that caused it.  The worst cases
  328.     are sequences such as a write fault followed by a branch
  329.     instruction.  In these cases, the branch is usually already
  330.     executed before the write fault happens and thus the PC
  331.     will be pointing to the target of the branch.  There is nothing
  332.     that can be done within Enforcer to help out here.  You will
  333.     just need to be aware of this and deal with it as best as possible.
  334.  
  335.     Along with the above issue, is the fact that since a write fault
  336.     may be delayed, a read fault may happen before the write fault
  337.     shows up.  Internally, enforcer does not do special processing
  338.     for these and they will not show up.  Since another hit was
  339.     happening anyway, it is felt that it is best to just not
  340.     report the hit.  Along the same lines, the hit generated
  341.     from a MOVEM instruction may only show as a single hit rather
  342.     than 1 for each register moved.
  343.  
  344.     On the Amiga, MOVE16 is not supported 100%.  Causing an Enforcer
  345.     hit with a MOVE16 will cause major problems and maybe cause
  346.     Enforcer or your task to lock.  Since MOVE16 is not supported,
  347.     this is not a major issue.  Just watch out if you are using
  348.     this 68040 instruction.  (Also, watch out for the 68040 CPU bug
  349.     with MOVE16)
  350.  
  351.     The functions CachePreDMA(), CachePostDMA(), and CacheControl()
  352.     are patched when the 68040 MMU is turned on by Enforcer.  These
  353.     functions are patched such the issues with DMA and the 68040
  354.     COPYBACK data caches are addressed.  The 68040.library normally
  355.     deals with this, however since Enforcer turns on the MMU, the
  356.     method of dealing with it in the 68040.library will not work.
  357.     For this reason, Enforcer will patch these and implement the
  358.     required fix for when the MMU is on.  When Enforcer is asked
  359.     to exit, it will check if it can remove itself from these
  360.     functions.  If it can not, it will ignore the request to
  361.     exit.  If Enforcer was run from the CLI, it will print a message
  362.     saying that it can not exit when the attempt is made.
  363.  
  364.    SEE ALSO
  365.     "A master's secrets are only as good as the
  366.      master's ability to explain them to others."  -  Michael Sinz
  367.  
  368.    BUGS
  369.     None?
  370.  
  371. LawBreaker                                                         LawBreaker
  372.  
  373.    NAME
  374.     LawBreaker - A quicky test of Enforcer
  375.  
  376.    SYNOPSIS
  377.     This is a quick test of Enforcer and its reporting abilities.
  378.  
  379.    FUNCTION
  380.     This program is used to make sure that Enforcer is correctly
  381.     installed and operating.  LawBreaker works from either the CLI
  382.     or Workbench.  It will try to read and write certain memory
  383.     areas that will cause an Enforcer hit or four.
  384.  
  385.    INPUTS
  386.     Just run it...
  387.  
  388.    RESULTS
  389.     When running Enforcer, you will see some output from Enforcer.
  390.     Output on a 68030 machine would look something like this:
  391.  
  392. WORD-WRITE to  00000000        data=0000       PC: 0783AC6A
  393. USP:  078CAAEC SR: 0004 SW: 0729  (U0)(-)(-)  TCB: 078AADF8
  394. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  395. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  396. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  397. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  398. PC-8: AAAA1111 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C00000
  399. PC *: 522E0127 201433FC 400000DF F09A522E 012611C1 01004EAE FF7621C0 0104532E
  400. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 0000007A
  401.  
  402. LONG-READ from AAAA4444                        PC: 0783AC6E
  403. USP:  078CAAEC SR: 0015 SW: 0749  (U0)(F)(-)  TCB: 078AADF8
  404. Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  405. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  406. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  407. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  408. PC-8: 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C00000 522E0127
  409. PC *: 201433FC 400000DF F09A522E 012611C1 01004EAE FF7621C0 0104532E 01266C08
  410. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 0000007E
  411.  
  412. BYTE-WRITE to  00000100        data=11         PC: 0783AC80
  413. USP:  078CAAEC SR: 0010 SW: 0711  (U0)(F)(D)  TCB: 078AADF8
  414. Data: 00000000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  415. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  416. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  417. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  418. PC-8: 2A7CAAAA 555531C0 0000522E 01272014 33FC4000 00DFF09A 522E0126 11C10100
  419. PC *: 4EAEFF76 21C00104 532E0126 6C0833FC C00000DF F09A201F 66024E75 22404EEE
  420. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 00000090
  421.  
  422. LONG-WRITE to  00000104        data=00000000   PC: 0783AC88
  423. USP:  078CAAEC SR: 0014 SW: 0709  (U0)(-)(D)  TCB: 078AADF8
  424. Data: 00000000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  425. Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  426. Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  427. Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  428. PC-8: 0000522E 01272014 33FC4000 00DFF09A 522E0126 11C10100 4EAEFF76 21C00104
  429. PC *: 532E0126 6C0833FC C00000DF F09A201F 66024E75 22404EEE FE860024 5645523A
  430. Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 00000098
  431.  
  432.    NOTES
  433.     If enforcer is not running, the program should not cause the
  434.     system to crash.  It will, however, write to certain areas
  435.     of low memory.  Also, it will cause read access of some
  436.     addresses that may not exist.  This may cause bus faults.
  437.  
  438.    SEE ALSO
  439.     "Quantum Physics:  The Dreams that Stuff is made of." - Michael Sinz
  440.  
  441.    BUGS
  442.     There are 4 known Enforcer hits in this code, however, they
  443.     will not be fixed.  ;^)
  444.  
  445. Move4K                                                                 Move4K
  446.  
  447.    NAME
  448.     Move4K - Moves as much out of the lower 4K of RAM as possible
  449.  
  450.    SYNOPSIS
  451.     On 68040 systems, as much of the lower 4K of CHIP RAM is removed
  452.     from system use.
  453.  
  454.    FUNCTION
  455.     On 68040 systems the MMU page sizes are 4K and 8K.  Enforcer
  456.     uses the 4K page size.  Since watching for hits of low memory
  457.     is a vital part of Enforcer, this means that the first 4K
  458.     of RAM will be marked invalid.  On current systems, only
  459.     the first 1K of RAM is invalid and thus 3K of RAM in that
  460.     first 4K will end up needing to be emulated in Enforcer.
  461.     In order to reduce the overhead that this causes (and the
  462.     major performance loss) this program will try to move as much
  463.     from that first 4K as possible and make any of the free
  464.     memory within the first 4K inaccessible.
  465.  
  466.     Enforcer itself also has this logic, but it may be useful
  467.     to be able to run this program as the first program in
  468.     the Startup-Sequence (*AFTER* SetPatch) to try to limit
  469.     the number of things that may use the lower 4K of RAM.
  470.  
  471.    INPUTS
  472.     Just run it...  Can be run from CLI or Workbench
  473.  
  474.    RESULTS
  475.     Any available memory in the lower 4K of CHIP RAM is removed
  476.     plus a special graphics buffer is moved if it needs to be.
  477.     After running this program you may have a bit less CHIP RAM
  478.     than before.  You can run this program as many times as you
  479.     wish since it only moves things if it needs to.
  480.  
  481.    NOTES
  482.     This program will do nothing on systems without a 68040.
  483.     It does not, however, check for the FPU and thus it will
  484.     move the lower 4K even if the CPU is not able to run Enforcer.
  485.  
  486.    SEE ALSO
  487.     "Eloquence is vehement simplicity"
  488.  
  489.    BUGS
  490.     Other than the memory "loss" the first time it is run, none.
  491.  
  492.